package com.itheima.Test.TreeSet;

import java.util.Comparator;
import java.util.TreeSet;

public class TreeSetDemo02 {
    public static void main(String[] args) {
        TreeSet<Integer> ts=new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                int result=o2-o1;
                return result;
            }
        });
        ts.add(1);
        ts.add(2);
        ts.add(38);
        System.out.println(ts);
    }
}
